package test_package;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;

import java.util.concurrent.TimeUnit;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 22.11.13
 * Time: 13:15
 * To change this template use File | Settings | File Templates.
 */
public class buxfer_com_PO_MainPage {
    private static WebDriver driver;

    public buxfer_com_PO_MainPage (WebDriver driver){
        this.driver = driver;
    }
    public static buxfer_com_PO_LoginPage clickLoginBtn(){
        driver.findElement(By.xpath("//a[contains(text(),'Login')]")).click();
        return new buxfer_com_PO_LoginPage(driver);
    }

    public buxfer_com_PO_AccountPage login(String login, String password) {
        driver.findElement(By.id("login_username")).sendKeys(login);
        driver.findElement(By.id("login_password")).sendKeys(password);
        driver.findElement(By.xpath("//a[contains(text(),'Login')]")).click();
        return new buxfer_com_PO_AccountPage(driver);
    }

}
